//------------------------------------------------------------------------------
//  <copyright file="Circle.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//  </copyright>
//------------------------------------------------------------------------------

namespace Microsoft.Robotics.Geometry
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.Text;
    using System.Threading.Tasks;

    using Microsoft.Robotics.Numerics;

    /// <summary>
    /// Class representing a circle.
    /// </summary>
    [DataContract]
    public class Circle : GeometryElement2D
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Circle"/> class.
        /// </summary>
        /// <param name="center">Center of circle.</param>
        /// <param name="radius">Radius of circle.</param>
        public Circle(Point2D center, double radius)
        {
            if (radius <= 0)
            {
                throw new ArgumentException(string.Format("radius must be > 0, recieved: {0}", radius));
            }

            this.Center = center;
            this.Radius = radius;
        }

        /// <summary>
        /// Gets the circle radius.
        /// </summary>
        [DataMember]
        public double Radius { get; private set; }

        /// <summary>
        /// Gets the circle center
        /// </summary>
        [DataMember]
        public Point2D Center { get; private set; }

        /// <summary>
        /// Compute the distance from another geometry element to the line
        /// </summary>
        /// <param name="e">A geometry element.</param>
        /// <returns>A distance.</returns>
        public override double DistanceFrom(GeometryElement2D e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets a (possibly empty) list of points at which two geometry elements intersect.
        /// Only indicates where intersections occur at discrete points between the hull, not area of elements, or 
        /// intersections that form something other than a point.
        /// </summary>
        /// <param name="e"> A geometry element.</param>
        /// <returns>A list of the distinct points at which the given geometry intersects this geometry.</returns>
        public override List<Point2D> GetIntersectionPoints(GeometryElement2D e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets a (possibly empty) list of non-point geometries at which two geometry elements intersects.
        /// Only indicates non-point intersections between the hulls of the geometries, not intersections of areas or
        /// intersections that occur at a point only.
        /// </summary>
        /// <param name="e"> A geometry element. </param>
        /// <returns>A list of the geometries describing the intersection of the two geometries excepting point intersections.</returns>
        public override List<GeometryElement2D> GetIntersectionGeometries(GeometryElement2D e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets a value indicating whether or not geometries intersect (without determining points or geometry of intersection).
        /// </summary>
        /// <param name="e">A 2D geometry element.</param>
        /// <returns>True if geometries intersect.</returns>
        public override bool Intersects(GeometryElement2D e)
        {
            throw new NotImplementedException();
        }
    }
}
